<?php

/**
 * sfCronManagerJob form base class.
 *
 * @method sfCronManagerJob getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasesfCronManagerJobForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'title'                   => new sfWidgetFormInputText(),
      'command'                 => new sfWidgetFormTextarea(),
      'schedule'                => new sfWidgetFormTextarea(),
      'active'                  => new sfWidgetFormInputCheckbox(),
      'load_limit'              => new sfWidgetFormInputText(),
      'current_suppressed_runs' => new sfWidgetFormInputText(),
      'max_suppressed_runs'     => new sfWidgetFormInputText(),
      'run_if_missed'           => new sfWidgetFormInputCheckbox(),
      'last_ran'                => new sfWidgetFormDateTime(),
      'next_run'                => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'title'                   => new sfValidatorString(array('max_length' => 100)),
      'command'                 => new sfValidatorString(array('max_length' => 1000)),
      'schedule'                => new sfValidatorString(array('max_length' => 1000)),
      'active'                  => new sfValidatorBoolean(array('required' => false)),
      'load_limit'              => new sfValidatorNumber(array('required' => false)),
      'current_suppressed_runs' => new sfValidatorInteger(array('required' => false)),
      'max_suppressed_runs'     => new sfValidatorInteger(array('required' => false)),
      'run_if_missed'           => new sfValidatorBoolean(array('required' => false)),
      'last_ran'                => new sfValidatorDateTime(array('required' => false)),
      'next_run'                => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sf_cron_manager_job[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sfCronManagerJob';
  }

}
